
package com.amado.course03;

/**
 * @author wangyl-910
 * @description
 * @date 2018/4/4
 * @see
 */
public class ShortType {

    public static void main(String[] args) {
        short myShort = 2;
        short twoShort =3;
        twoShort = (short)(myShort +twoShort);
        // 对于short s1 = 1; s1 += 1;由于 += 是java语言规定的运算符，java编译器会对它进行特殊处理，因此可以正确编译
        //+= myShort = myshort +20
        myShort += 20;

        // 精度小于int的数值运算的时候都回被自动转换为int后进行计算
        myShort = (short) (myShort + 20);

        char c = 'a';
        int i = 5;
        double d = .314;
        double result = c + i + d;
        System.out.println(result);

    }
}
